| Conditions | 2 |
| Total Lines | 9 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { Inject } from '@nestjs/common'; |
||
| 15 | |||
| 16 | public async isSatisfiedBy(school: School, userId: string): Promise<boolean> { |
||
| 17 | const user = await this.userRepository.findOneById(userId); |
||
| 18 | if (!user) { |
||
| 19 | return false; |
||
| 20 | } |
||
| 21 | |||
| 22 | return user.getRole() === UserRole.PHOTOGRAPHER || |
||
| 23 | (await this.schoolUserRepository.findOneByUserAndSchool(user, school)) instanceof SchoolUser; |
||
| 24 | } |
||
| 26 |